// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
import VueResource from 'vue-resource'
Vue.use(VueResource)
Vue.http.options.root = 'http://192.168.1.105:8899'
Vue.http.options.emulateJSON = true //全局设置post时候表单数据格式
import './assets/reset.css'
Vue.config.productionTip = false
import  {path,homePage} from './js/path'
Vue.prototype._path = path;
Vue.prototype.homePage = homePage;
import  { filter } from './js/filter'
Vue.prototype._filter = filter;
import {request} from './js/request'
Vue.prototype.requestError = request;
// element-ui
// import ElementUI from 'element-ui'
// import 'element-ui/lib/theme-chalk/index.css'
// Vue.use(ElementUI)
// import Mint from 'mint-ui'
// Vue.use(Mint)

// import { Header, Swipe, SwipeItem, Button } from 'mint-ui'
// Vue.component(Header.name,Header)
// Vue.component(Swipe.name,Swipe)
// Vue.component(SwipeItem.name,SwipeItem)
// Vue.component(Button.name, Button)
// import { Lazyload } from 'mint-ui';

// Vue.use(Lazyload);
import Mint from 'mint-ui'
Vue.use(Mint)
import 'mint-ui/lib/style.css'

import './style/mui/css/mui.min.css' 
import './style/mui/css/icons-extra.css' 

import LyTab from 'ly-tab'

Vue.use(LyTab)
// vue预览图片插件
import VuePreview from 'vue-preview'
// Vue.use(VuePreview)
Vue.use(VuePreview, {
  mainClass: 'pswp--minimal--dark',
  barsSize: {top: 0, bottom: 0},
  captionEl: false,
  fullscreenEl: false,
  shareEl: false,
  bgOpacity: 0.85,
  tapToClose: true,
  tapToToggleControls: false
})
//定义全局过滤器

//全局时间格式过滤器
//导入时间插件
import moment from 'moment'
Vue.filter('dateFormat', function(dataStr,pattern="YYYY-MM-DD HH:mm:ss"){
  return moment(dataStr).format(pattern)
})

let vm = new Vue()
// $.ajax({
//   url:path + '/users/permissions',
//   type:'GET',
//   async:false,
//   success:(res)=>{
//     if(res.code == 'SUCCESS'){
//       var s = res.data.permissions;
//       Vue.prototype.permissions = res.data.permissions;
//     }else{
//       request(res,vm)
//     }

//   }
// })


// ajax
// import axios from 'axios'
// Vue.prototype.$http = axios
// Vue.config.productionTip = false

window.bus = new Vue()

/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  template: '<App/>',
  components: { App },

})

